// Icon type definition, contains absolute icon filenames.
// Copyright 2005 (C) Ralph Thomas

#ifndef TOOLKIT_BASE_ICON_H
#define TOOLKIT_BASE_ICON_H

#include <string>
#include <boost/filesystem/path.hpp>
#include <adobe/value.hpp>

namespace toolkit {
	//
	/// Return the icon for the given MIME type and the given
	/// local filesystem path. The path may be empty (in which
	/// case a generic icon for the MIME type will be used. A
	/// toolkit-specific value is returned that is understood
	/// by the icon implementation for this toolkit.
	///
	/// \param	type	the MIME type to return an icon for.
	/// \param	path	the filesystem path of the target
	///			(used for preview icons).
	/// \return	the requested icon, or preview if one has
	///		been previously created.
	//
	adobe::value_t getIcon( const std::string& type, const boost::filesystem::path& path );
	//
	/// Is there an icon preview already created for the given
	/// path? This function will return true if an icon preview
	/// exists and is valid, or if one couldn't be created
	/// previously (and the file's mtime indicates that it's
	/// still not possible to create one).
	///
	/// \param	path	the filesystem path to check.
	/// \return	the preview if it existed, otherwise an
	///		empty value_t.
	//
	adobe::value_t checkPreview( const std::string& type, const boost::filesystem::path& path );
	//
	/// Create a preview for the given path.
	///
	/// \param	path	the filesystem path to create a preview
	///			for.
	/// \return	the icon preview (if successful) otherwise an
	///		empty value.
	//
	adobe::value_t createPreview( const std::string& type, const boost::filesystem::path& path );
};

#endif

